package com.yijiajiao.finance.controller;

import com.yijiajiao.finance.bean.BatchPayDetail;
import com.yijiajiao.finance.bean.BatchPayDetailQuery;
import com.yijiajiao.finance.bean.ResultBean;
import com.yijiajiao.finance.service.BatchPayService;
import com.yijiajiao.finance.service.FinanceLogService;
import javafx.scene.control.Pagination;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @AUTHOR zhaoming@eduspace
 * @CREATE 2017-05-24-14:15
 */
@RestController
@RequestMapping("/batchpay")
public class BatchPayController {

    @Autowired
    private BatchPayService batchPayService;
    @Autowired
    private FinanceLogService financeLogService;

    /**
     * 批量转账
     */
    @GetMapping("/paylist")
    public ResultBean batchPay(List<BatchPayDetail> batchPayDetails){

        return batchPayService.batchPay(batchPayDetails);

    }

    /**
     * 获得教师的工资数据列表
     */ 
    @GetMapping("/salarylist")
    public ResultBean getTeacherSalaryList(String queryDate, String phone){

        Pagination pagination = batchPayService.querySettleInfo(queryDate, phone);
        return ResultBean.getSucResult(pagination);
        
    }

    @GetMapping("/salaryStatement")
    public ResultBean getSalaryStatement(BatchPayDetailQuery batchPayDetailQuery){
        return batchPayService.querySettleInfoByDate(batchPayDetailQuery);
    }
}
